home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 12 / 012.d81 / pps #27 < prev    next >
Text File  |  2022-08-26  |  2KB  |  99 lines

  1.  
  2.  PEEKs, POKEs, AND SYSes -- Part 27
  3.    -- continued from Part 26 --
  4.  
  5.  
  6.  
  7.  
  8.   Arrays start at VARTAB and end at
  9.  
  10. STREND.  Before you dimension your
  11.  
  12. first array, VARTAB and STREND both
  13.  
  14. point to the same location -- the end
  15.  
  16. of simple arrays.  Each time you use a
  17.  
  18. new BASIC array, it gets built at
  19.  
  20. STREND, and then STREND is changed to
  21.  
  22. point to the end of that new array.
  23.  
  24.   There's really no way to explain the
  25.  
  26. structure of arrays without resorting
  27.  
  28. to charts, so here they come!!!  Note
  29.  
  30. well that the arrays start at the
  31.  
  32. TOP of the chart, and as you read down
  33.  
  34. the memory addresses get higher.  This
  35.  
  36. is the reverse of the convention I
  37.  
  38. have been using.  If the meaning of
  39.  
  40. the chart isn't immediately clear to
  41.  
  42. you, try reading the explanations that
  43.  
  44. follow it.
  45.  
  46.  
  47.   ARYTAB points to the beginning of
  48.  
  49. the first array.  All arrays are
  50.  
  51. organized like this:
  52.  
  53.  
  54.   A.  Two bytes for the name
  55.  
  56.   B.  Two bytes for an index to the
  57.       next variable name.
  58.  
  59.   C.  One byte to tell how many
  60.       dimensions.
  61.  
  62.   D.  Two bytes for each dimension to
  63.       tell how many elements each
  64.       dimension has
  65.  
  66.   E.  The actual array variables
  67.  
  68.  
  69.  Every array has these five areas,
  70.  
  71. as charted below:
  72.  
  73.  
  74. ======================================
  75. CHART 2:
  76. What arrays look like in general.
  77. --------------------------------------
  78. purpose of area   size of area
  79.  
  80.    +----------+
  81. A  !name      !   always 2 bytes
  82.    +----------+
  83. B  !offset to !   always 2 bytes
  84.    !next array!
  85.    !name      !
  86.    +----------+
  87. C  !number of !   always 1 byte
  88.    !dimensions!
  89.    +----------+
  90. D  !sizes of  !   always 2 bytes per
  91.    !dimensions!   dimension
  92.    +----------+
  93. E  !variables !   size varies with
  94.    !          !   variable type and
  95.    +----------+   size of dimensions
  96. ======================================
  97.  
  98. -------< continued in Part 28 >-------
  99.